package org.lee.datasource.configuration;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author lizhe
 */
public class DynamicRoutingDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        logger.info("Current DataSource is [{" + DynamicDataSourceContextHolder.getDataSourceKey() + "}]");
        return DynamicDataSourceContextHolder.getDataSourceKey();
    }
}
